package com.qfedu.common.mq.task;

import com.qfedu.common.mq.service.MqRetryService;
import com.qfedu.common.redis.annotation.MyLock;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Classname MqTask
 * @Description TODO
 * @Date 2025-09-30 13:56
 * @Created by 老任与码
 */
@Component
public class MqTask {

    @Resource
    private MqRetryService mqRetryService;

    // 可以一个小时扫描一次
    // @Scheduled(cron = "0 0 * * * ?")
    @MyLock(lockName = "lock:mq:retry")
    @Scheduled(cron = "0/10 * * * * ?")
    public void reTryMsg() {
        mqRetryService.resendMsgTask();
    }
}
